public class Solution {
    public int brokenCalc(int startValue, int target) {
        int count = 0;
        while (target != startValue) {
            count++;
            if (target < startValue) {
                target++;
                // count++;
            } else {
                // count++;
                if (target % 2 != 0) {
                    target++;
                } else {
                    target /= 2;
                }
            }
        }

        return count;
    }
}
